const nodemailer = require('nodemailer')
const transporter = nodemailer.createTransport({
  service: '163',
  auth: {
    user: 'zywork6@163.com',
    pass: 'QCZJXAEHNTBQHCGT'
  }
})

function sendMail(receiver, code) {
  return transporter.sendMail({
    from: `诊所<zywork6@163.com>`,
    subject: 'test title',
    to: receiver,
    html: `
    <h1>找回密码验证码</h1>
    <p>${code}</p>
  `
  })
}
module.exports = sendMail
